/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sessionBeans;

import entity.Hospital;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Minh Luc
 */
@Stateless
public class HospitalFacade extends AbstractFacade<Hospital> implements HospitalFacadeLocal {
    @PersistenceContext(unitName = "WebBasedClaimProcessing-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public HospitalFacade() {
        super(Hospital.class);
    }

    public List<Hospital> findByHospitalAction() {
        String sQuery ="SELECT h FROM Hospital h WHERE h.isLock = :isLock";
        Query query =em.createQuery(sQuery);
        query.setParameter("isLock", false);
        return query.getResultList();
    }
    

}
